<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改联系人提醒')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-reminder-edit" th:object="${contactReminder}">
        <input name="reminderId" th:field="*{reminderId}" type="hidden">
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">联系人ID：</label>
                <div class="col-sm-8">
                    <input name="contactId" th:field="*{contactId}" class="form-control" type="text" required>
                    <div class="col-xs-12">
                        <div class="form-group">
                            <label class="col-sm-3 control-label is-required">提醒类型: </label>
                            <div class="col-sm-8">
                                <select name="reminderType" class="form-control" th:with="types=${@dict.getType('contact_reminder_type')}" required>
                                    <option th:each="dict : ${types}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </div>
                        </div>
                    </div>
                    <div class="col-xs-12">
                        <div class="form-group">
                            <label class="col-sm-3 control-label is-required">重复类型: </label>
                            <div class="col-sm-8">
                                <select name="repeatType" class="form-control" th:with="types=${@dict.getType('contact_repeat_type')}" required>
                                    <option th:each="dict : ${types}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">提醒时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input type="text" class="form-control"
                               name="reminderTime" id="reminderTime" placeholder="请选择提醒时间：年月日时分秒"
                               th:value="${#dates.format(contactReminder.reminderTime, 'yyyy-MM-dd HH:mm:ss')}">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>

                    </div>
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">是否重复(0-否,1-是)：</label>
                <div class="col-sm-8">
                    <input name="isRepeat" th:field="*{isRepeat}" class="form-control" type="text" required>
                </div>
            </div>
        </div>
        <div class="col-xs-12">
            <div class="form-group">
                <label class="col-sm-3 control-label">用户ID：</label>
                <div class="col-sm-8">
                    <input name="userId" th:field="*{userId}" class="form-control" type="text">
                </div>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
    var prefix = ctx + "contact/reminder";
    $("#form-reminder-edit").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-reminder-edit').serialize());
        }
    }

      <!--使用laydate设置时间 -->
      layui.use('laydate', function(){
      var laydate = layui.laydate;
      laydate.render({
      elem:'#reminderTime",//时间输入组件的ID
      type: 'datetime',
      trigger:'click'
      });
      });// layui.use()
</script>
</body>
</html>